/**
 * RPC Interface
 */
package org.hackystat.ui.telemetryviewer.client.common;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Remote procedure call interface for communicating with the Twitter server. 
 * 
 * @author David J. Nickles
 */
public interface RPCRemoteServiceAsync {
  
  /**
   * This method yields a name and general description for each of the available charts.
   * @param session the host and user attributes.
   * @param callback address of return function.
   */
  public void getCharts(Session session, AsyncCallback callback);
  
  /**
   * Return a detailed description of the chart definition.
   * @param session the host and user attributes.
   * @param chart the name of the requested chart.
   * @param callback address of return function.
   */
  public void getChartDefinition(Session session, String chart, AsyncCallback callback);
  
  /**
   * Return the telemetry data set for a chart service.
   * @param session the session attributes.
   * @param chart the name of the requested chart.
   * @param params the list of chart parameters.
   * @param start XML formatted timestamp for beginning of data interval.
   * @param end XML formatted timestamp for end of data interval.
   * @param callback address of return function.
   */
  public void getChartData(Session session, String chart, String params, 
    String start, String end, AsyncCallback callback);
  
  /**
   * Return the data set for a chart in JSON format.
   * @param sensorbase URI for the Sensorbase service.
   * @param telemetry URI for the Telemetry service.
   * @param user user to authentication.
   * @param password user password for authentication.
   * @param chart the name of the requested chart.
   * @param params the list of chart parameters.
   * @param project the name of the requested project.
   * @param granularity the granularity of the requested chart.
   * @param start XML formatted timestamp for beginning of data interval.
   * @param end XML formatted timestamp for end of data interval.
   * @param callback address of return function.
   */
//  public void getJSONDataset(String sensorbase, String telemetry, 
//    String user, String password,
//    String chart, String params, String project, String granularity, String start, String end, 
//    AsyncCallback callback);
  
  /**
   * This method retrieves the host uris for the Sensorbase and Telemetry services from the
   * Telemetry Viewer properties file.
   * 
   * @param callback the re-entry method
   */
  public void getHosts(AsyncCallback callback);

  /**
   * Returns true if the passed host is a Telemetry Analysis service host.
   * 
   * @param host the URI for the Telemetry service.
   * @param callback the re-entry method
   */
  public void isTelemetryHost(String host, AsyncCallback callback);

  /**
   * Returns true if the passed host is a DPD Analysis service host.
   * 
   * @param host the URI for the DPD service.
   * @param callback the re-entry method
   */
  public void isDPDHost(String host, AsyncCallback callback);

  /**
   * Returns true if the passed host is a SensorBase service host.
   * 
   * @param host the URI for the SensorBase
   * @param callback the re-entry method
   */
  public void isSensorBaseHost(String host, AsyncCallback callback);

  /**
   * Returns true if the user and password is registered as a user with this host.
   * @param session the host and user attributes.
   * @param callback the re-entry method
   */
  public void isRegistered(Session session, AsyncCallback callback);

  /**
   * Registers the user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @param callback the re-entry method
   */
  public void registerUser(String host, String user, AsyncCallback callback);
  
  /**
   * Returns the attributes set in the Manifest file.
   * 
   * @param callback address of return function.
   */
  public void getManifest(AsyncCallback callback); 
  
  /**
   * Return a formatted description of the requested data overview for the specified interval.
   * @param session the host and user attributes.
   * @param year of interval
   * @param month of interval
   * @param callback address of return function
   */
  public void getOverview(Session session, int year, int month, AsyncCallback callback);

  /**
   * Returns the index of all Projects from this server for this user.
   * @param session host and user information.
   * @param callback address of return function
   */
  public void getProjects(Session session, AsyncCallback callback);

  /**
   * Logs the message from the javascript client.
   * 
   * @param text message to log.
   * @param callback address of return function
   */
  public void logClient(String text, AsyncCallback callback);
}
